﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_Admin_DSJCJ.BLL
{
    /// <summary>
    /// WeekPlan业务说明
    /// </summary>
    public class WeekPlan
    {
        /// <summary>
        /// DAL定义的便利
        /// </summary>
        private readonly DAL.WeekPlan dal = new DAL.WeekPlan();

        /// <summary>
        /// 获取第几周
        /// </summary>
        /// <returns>时间列表</returns>
        public DataSet GetTime(string endDate)
        {
            return dal.GetTime(endDate);
        }


        /// <summary>
        /// 获取年度
        /// </summary>
        /// <returns>时间列表</returns>
        public DataSet GetYear(string endDate)
        {
            return dal.GetYear(endDate);
        }
        /// <summary>
        /// 获得这周是几号到几号
        /// </summary>
        /// <param name="gowk">参数</param>
        /// <returns>时间列表</returns>
        public DataSet GetDate(int gowk)
        {
            return dal.GetDate(gowk);
        }

        /// <summary>
        /// 获得时间的差异
        /// </summary>
        /// <param name="gowk">周的一个参数</param>
        /// <returns>数据列表</returns>
        public DataSet GetTimeDiff(int gowk)
        {
            return dal.GetTimeDiff(gowk);
        }


        /// <summary>
        /// 获得主岗位部门
        /// </summary>
        /// <returns>数据列表</returns>
        public DataSet GetDept()
        {

            return dal.GetDept();
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        /// <param name="fWeek">周</param>
        /// <param name="fYear">年</param>
        /// <param name="fEmplNo">人员编号</param>
        /// <param name="fEntityNo">公司编号</param>
        /// <returns>一个对象实体</returns>
        public ElingOA6_Admin_DSJCJ.Model.WeekPlan GetModel(decimal fWeek, decimal fYear, string fEmplNo, string fEntityNo)
        {
            return dal.GetModel(fWeek,fYear, fEmplNo, fEntityNo);
        }
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="fWeek">周</param>
        /// <param name="fYear">年</param>
        /// <param name="fEmplNo">人员编号</param>
        /// <param name="fEntityNo">公司编号</param>
        /// <returns>是否存在该记录</returns>
        public bool Exists(decimal fWeek, decimal fYear, string fEmplNo, string fEntityNo)
        {
            return dal.Exists(fWeek,fYear, fEmplNo, fEntityNo);
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="model">Model对象</param>
        /// <returns>插入几个</returns>
        public decimal Add(ElingOA6_Admin_DSJCJ.Model.WeekPlan model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="model">Model对象</param>
        /// <returns>是否更新</returns>
        public bool Update(ElingOA6_Admin_DSJCJ.Model.WeekPlan model)
        {
            return dal.Update(model);
        }
        /// <summary>
        /// 审核更新一条数据
        /// </summary>
        /// <param name="model">Model对象</param>
        /// <returns>是否更新</returns>
        public bool UpdateCheck(ElingOA6_Admin_DSJCJ.Model.WeekPlan model)
        {
            return dal.UpdateCheck(model);
        }


        /// <summary>
        /// 得到人员编号和人员名称
        /// </summary>
        /// <param name="deptNo">部门编号</param>
        /// <returns>数据列表</returns>
        public DataSet GetEmpNo(string deptNo)
        {
            return dal.GetEmpNo(deptNo);
        }
        /// <summary>
        /// 得到人员编号和人员名称
        /// </summary>
        /// <param name="deptNoList">部门编号列表</param>
        /// <returns>数据列表</returns>
        public DataSet GetEmpNoByDeptNoList(List<string> deptNoList)
        {
            return dal.GetEmpNoByDeptNoList(deptNoList);
        }
        /// <summary>
        /// 没有审核人员的信息
        /// </summary>
        /// <param name="empNo">人员编号</param>
        /// <param name="entity">公司编号</param>
        /// <returns>数据列表</returns>
        public DataSet GetNoAuIn(string empNo, string entity)
        {

            return dal.GetNoAuIn(empNo, entity);
        }

        /// <summary>
        /// 得到需要考核人员数目
        /// </summary>
        /// <param name="empNo">人员编号</param>
        /// <param name="entity">公司编号</param>
        /// <returns>数据列表</returns>
        public DataSet GetCou(string empNo, string entity)
        {
            return dal.GetCou(empNo, entity);
        }

        /// <summary>
        /// 得到非工作日
        /// </summary>
        /// <param name="startDate">本周开始的日期</param>
        /// <param name="endDate">本周结束的日期</param>
        /// <returns>返回几条记录</returns>
        public decimal GetNoWorkDay(string startDate, string endDate)
        {
            return dal.GetNoWorkDay(startDate, endDate);
            
        }

        /// <summary>
        ///  周工作计划未按时上报-未及时上报
        /// </summary>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>数据列表</returns>
        public DataSet GetNoWeekPlan(string startDate, string endDate)
        {
            return dal.GetNoWeekPlan(startDate, endDate);

        }
        /// <summary>
        /// 工作计划未按时审核
        /// </summary>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>数据列表</returns>
        public DataSet GetNoCheck(string startDate, string endDate)
        {
            return dal.GetNoCheck(startDate, endDate);
        }

        /// <summary>
        /// 日志未完整登记
        /// </summary>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>数据列表</returns>
        public DataSet GetNoReg(string startDate, string endDate)
        {
            return dal.GetNoReg(startDate, endDate);
        }

        /// <summary>
        /// 需要考核的部门（不是外派机构）
        /// </summary>
        /// <returns>数据列表</returns>
        public DataSet GetCheckDept()
        {
            return dal.GetCheckDept();
        }

        /// <summary>
        /// 需要考核人员
        /// </summary>
        /// <param name="fDeptNO">部门编号</param>
        /// <returns>数据列表</returns>
        public DataSet GetChechEmp(string fDeptNO)
        {
            return dal.GetChechEmp(fDeptNO);
        }


        /// <summary>
        /// 得到工作人员的名字
        /// </summary>
        /// <param name="empNo">人员编号</param>
        /// <returns>字符</returns>
        public string GetempName(string empNo)
        {
            return dal.GetempName(empNo);           
        }

        /// <summary>
        /// 查看页面的显示文字
        /// </summary>
        /// <param name="beginDate">开始日期</param>
        /// <param name="empNo">人员编号</param>
        /// <returns>数据列表</returns>
        public DataSet GetPlanText(string beginDate, string empNo)
        {
            return dal.GetPlanText(beginDate, empNo);
        }


        /// <summary>
        /// 获得所有科室所有未及时上报和未及时审核的计数
        /// </summary>
        /// <returns>数据列表</returns>
        public DataSet GetAllData(string entityNo)
        {
            return dal.GetAllData(entityNo);
        }

        ///// <summary>
        ///// 得到组权限
        ///// </summary>
        ///// <param name="empNo">人员编号</param>
        ///// <returns>字符</returns>
        //public DataSet GetGroupNo(string empNo)
        //{
        //    return dal.GetGroupNo(empNo);    
        //}


        ///// <summary>
        ///// 得到表权限
        ///// </summary>
        ///// <param name="empNo">人员编号</param>
        ///// <returns>数据表</returns>
        //public DataSet GetGroupPrv(string groupNo)
        //{
        //    return dal.GetGroupPrv(groupNo);
        //}

    }
}
